<%--
  Created by IntelliJ IDEA.
  User: 17728
  Date: 2020/10/12
  Time: 15:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <%@ include file="/pages/common/head.jsp" %>
    <script type="text/javascript">
        $(function () {
            // 给 【删除】绑定单击事件
            $("a.deleteItem").click(function () {
                return confirm("你确定要删除 【" + $(this).parent().parent().find("td:first").text() + "】吗?")
            });
        });
    </script>
    <style type="text/css">
        .a {
            width: 60vw;
            height: 550px;
            margin: 0 auto;
            position: relative;
            top: 50px;
        }

        .b {

            height: 480px;
        }


    </style>
</head>
<body>
<div class="a">
    <div class="b">
        <table align="center" class="table table-hover">
            <thead align="center">
            <td colspan="4" align="center"><h3><a href="pages/admin/class/admin_class_edit.jsp">添加班级信息</a></h3></td>

            <tr>
                <td>id</td>
                <td>cname</td>
                <td>修改</td>
                <td>删除</td>
            </tr>
            </thead>

            <c:forEach items="${requestScope.classes}" var="classes">
                <tr align="center">
                    <td>${classes.id}</td>
                    <td>${classes.cname}</td>
                    <td><a href="ClassServlet?action=queryClassById&id=${classes.id}">修改</a></td>
                    <td><a class="deleteItem" href="ClassServlet?action=deleteClass&id=${classes.id}">删除</a></td>
                </tr>
            </c:forEach>

        </table>
    </div>

</div>

</body>
</html>
